//echaets.js
; !function () {
    // 1.计划统计控件
    var myChart1 = echarts.init(document.getElementById('main1'));
    var option1 = {
        title: {
            text: '计划进度统计表'
        },
        tooltip: {
            trigger: 'axis'
        },
        legend: {
            data:['总工程量','完成工程量','剩余工程量']
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        toolbox: {
            feature: {
                saveAsImage: {}
            }
        },
        xAxis: {
            type: 'category',
            boundaryGap: false,
            data: ['周一','周二','周三','周四','周五','周六','周日']
        },
        yAxis: {
            type: 'value'
        },
        series: [
            {
                name:'总工程量',
                type:'line',
                stack: '总量',
                data:[120, 132, 101, 134, 90, 230, 210]
            },
            {
                name:'完成工程量',
                type:'line',
                stack: '总量',
                data:[220, 182, 191, 234, 290, 330, 310]
            },
            {
                name:'剩余工程量',
                type:'line',
                stack: '总量',
                data:[150, 232, 201, 154, 190, 330, 410]
            }
        ]
    };
    myChart1.setOption(option1);
    // 3.计划情况统计分析表

    var myChart31 = echarts.init(document.getElementById('main31'));
    var option31 = {
        title: {
            text: '完成量'
        },
        tooltip: {},
        legend: {
            data:['销量']
        },
        xAxis: {
            data: ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子","衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"]
        },
        yAxis: {},
        series: [{
            name: '销量',
            type: 'bar',
            data: [5, 20, 36, 10, 10, 20,5, 20, 36, 10, 10, 20]
        }]
    };
    myChart31.setOption(option31);
    // 3.2
    var myChart32 = echarts.init(document.getElementById('main32'));
    var option32 = {
        title : {
            text: '部门任务数',
            x:'center'
        },
        tooltip : {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        legend: {
            orient: 'vertical',
            left: 'left',
            data: ['产品','财务','技术','销售']
        },
        series : [
            {
                name: '任务完成量',
                type: 'pie',
                radius : '55%',
                center: ['50%', '60%'],
                data:[
                    {value:335, name:'产品'},
                    {value:310, name:'财务'},
                    {value:234, name:'技术'},
                    {value:135, name:'销售'}
                ],
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };
    
    myChart32.setOption(option32);
    // 3.3
    var myChart33 = echarts.init(document.getElementById('main33'));
    var option33 = {
        title : {
            text: '任务状态',
            x:'center'
        },
        tooltip : {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        legend: {
            orient: 'vertical',
            left: 'left',
            data: ['进行中','已完成','已延期','已取消','暂停中']
        },
        series : [
            {
                name: '任务完成量',
                type: 'pie',
                radius : '55%',
                center: ['50%', '60%'],
                data:[
                    {value:335, name:'进行中'},
                    {value:310, name:'已完成'},
                    {value:234, name:'已取消'},
                    {value:234, name:'已延期'},
                    {value:1352, name:'暂停中'}

                ],
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };
    
    myChart33.setOption(option33);
    console.log(1)
    }()